﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGiFillData : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGiFillData(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGiFillData obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGiFillData()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGiFillData(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public OdGiFillData(OdGiConveyorContext pDrawCtx, OdGiSubEntityTraits pTraits, LineWeight lweight, OdGiFillType fillType) : this(GlobalsPINVOKE.new_OdGiFillData__SWIG_0(pDrawCtx.GetCPtr(), OdGiSubEntityTraits.getCPtr(pTraits), (int)lweight, (int)fillType), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGiFillData(OdGiConveyorContext pDrawCtx, OdGiSubEntityTraits pTraits, LineWeight lweight) : this(GlobalsPINVOKE.new_OdGiFillData__SWIG_1(pDrawCtx.GetCPtr(), OdGiSubEntityTraits.getCPtr(pTraits), (int)lweight), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGiFillData(OdGiConveyorContext pDrawCtx, OdGiSubEntityTraits pTraits) : this(GlobalsPINVOKE.new_OdGiFillData__SWIG_2(pDrawCtx.GetCPtr(), OdGiSubEntityTraits.getCPtr(pTraits)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void set(LineWeight lweight, OdGiFillType fillType, OdGeVector3d fillNormal)
		{
			GlobalsPINVOKE.OdGiFillData_set(this.swigCPtr, (int)lweight, (int)fillType, OdGeVector3d.getCPtr(fillNormal));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public LineWeight m_lweight
		{
			get
			{
				LineWeight result = (LineWeight)GlobalsPINVOKE.OdGiFillData_m_lweight_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGiFillData_m_lweight_set(this.swigCPtr, (int)value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdGiFillType m_fillType
		{
			get
			{
				OdGiFillType result = (OdGiFillType)GlobalsPINVOKE.OdGiFillData_m_fillType_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGiFillData_m_fillType_set(this.swigCPtr, (int)value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdGeVector3d m_fillNormal
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.OdGiFillData_m_fillNormal_get(this.swigCPtr);
				OdGeVector3d result = (intPtr == IntPtr.Zero) ? null : new OdGeVector3d(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGiFillData_m_fillNormal_set(this.swigCPtr, OdGeVector3d.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdGeVector3d m_pFillNormal
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.OdGiFillData_m_pFillNormal_get(this.swigCPtr);
				OdGeVector3d result = (intPtr == IntPtr.Zero) ? null : new OdGeVector3d(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGiFillData_m_pFillNormal_set(this.swigCPtr, OdGeVector3d.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdGiSubEntityTraits m_pTraits
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.OdGiFillData_m_pTraits_get(this.swigCPtr);
				OdGiSubEntityTraits result = (intPtr == IntPtr.Zero) ? null : new OdGiSubEntityTraits(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGiFillData_m_pTraits_set(this.swigCPtr, OdGiSubEntityTraits.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdGiConveyorContext m_pDrawCtx
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.OdGiFillData_m_pDrawCtx_get(this.swigCPtr);
				OdGiConveyorContext_Internal result = (intPtr == IntPtr.Zero) ? null : new OdGiConveyorContext_Internal(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGiFillData_m_pDrawCtx_set(this.swigCPtr, value.GetCPtr());
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;
	}
}
